//
//  KATTableView.h
//  KATFramework
//
//  Created by Kantice on 15/8/4.
//  Copyright (c) 2015年 KatApp. All rights reserved.
//  列表视图
//  在删除或者其他有动画效果的事件未处理完成时重新加载数据，会有可能因为后续动画导致加载的新内容有误，应避免这种情况；
//  排序方法用的是二叉树，应避免在大量数据存在时连续使用同种类型的排序，如连续进行对tag的排序(已经用红黑树解决了该问题)；
//  为了防止循环引用，从父视图中删除时，会自动停止定时器，若要重现开启，则需要重新加载数据


#import <UIKit/UIKit.h>
#import "KATArray.h"
#import "KATTableCell.h"
#import "KATTableCellData.h"
#import "KATButton.h"
#import "KATTableViewDelegate.h"
#import "KATHashMap.h"
#import "KATTreeMap.h"
#import "KATTextStyle.h"
#import "KATSprite.h"
#import "KATStandardTableHeader.h"
#import "KATStandardTableFooter.h"
#import "KATImageUtil.h"


#define TABLE_CELL_HEIGHT_DEFAULT 60
#define TABLE_HEADER_HEIGHT_DEFAULT 60

#define TABLE_CELLS_DISPLAY_MAX 100
#define TABLE_CELLS_DISPLAY_TIMES 3

#define TABLE_STATE_INIT -1
#define TABLE_STATE_READY 0
#define TABLE_STATE_RELOAD 1
#define TABLE_STATE_MORE 2
#define TABLE_STATE_SCROLL 4
#define TABLE_STATE_RELOAD_WAIT 7
#define TABLE_STATE_MORE_WAIT 8
#define TABLE_STATE_UPDATE 10
#define TABLE_STATE_ADD 11
#define TABLE_STATE_REMOVE 12
#define TABLE_STATE_MOVE 13
#define TABLE_STATE_SORT 14


#define TABLE_MOVE_STOP 0
#define TABLE_MOVE_UP 1
#define TABLE_MOVE_DOWN 2

#define TABLE_CHANGE_NONE 0
#define TABLE_CHANGE_UP 1
#define TABLE_CHANGE_DOWN 2


#define TABLE_REMOTE_IMAGE_LOADING 0
#define TABLE_REMOTE_IMAGE_OK 1
#define TABLE_REMOTE_IMAGE_FAIL 2



@class KATTableBuilder;

@interface KATTableView : KATSprite <UIScrollViewDelegate,UIGestureRecognizerDelegate,KATTableHeaderDelegate,KATTableFooterDelegate,UITextViewDelegate>
{
    BOOL _cellPanDisabled;//单元格拖动事件向下传递标识量
    BOOL _isScrollDisabled;//配合cell的拖动事件，让scrollView暂时停止滚动事件
    
    BOOL _hasScrolledUp;//向上滚动标记(用于判断滚动事件)
    BOOL _hasScrolledDown;//向下滚动标记(用于判断滚动事件)
    
    BOOL _isLoadingMore;//是否加载更多标记(用于解决上推更多时的不刷新问题)
}


#pragma -mark 属性

///事件代理
@property(nonatomic,assign) id<KATTableViewDelegate> eventDelegate;

///构造器（方便配置）
@property(nonatomic,retain) KATTableBuilder *builder;

///滚动视图
@property(nonatomic,retain,readonly) UIScrollView *scrollView;

///是否显示滚动指示器
@property(nonatomic,assign) BOOL isShownScrollIndicator;

///最多显示的cell数量
@property(nonatomic,assign) int cellsDisplayMax;

///显示的cell占frame屏幕的倍数
@property(nonatomic,assign) int cellsDisplayTimes;

///单页显示的cell数量
@property(nonatomic,assign) int cellsDisplayCount;

///移动方向
@property(nonatomic,assign) int movingDirection;

///cell重用方向
@property(nonatomic,assign) int changeDirection;

///被删除的cell个数
@property(nonatomic,assign) int cellsRemoved;

///点击的cell num
@property(nonatomic,assign) int tapedCellNum;

///cell的宽度
@property(nonatomic,assign) double cellWidth;

///cell的高度
@property(nonatomic,assign) double cellHeight;

///cell的上间距
@property(nonatomic,assign) double cellMarginTop;

///cell的下间距
@property(nonatomic,assign) double cellMarginBottom;

///cell的内间距
@property(nonatomic,assign) double cellMarginInner;

///滚动速度
@property(nonatomic,assign) double scrollSpeed;

///高速滚动
@property(nonatomic,assign) double highScrollSpeed;

///初始放置点的y坐标
@property(nonatomic,assign) double startPositionY;

///最后的cell内容y坐标
@property(nonatomic,assign) double endPositionY;

///底部插入的高度
@property(nonatomic,assign) double bottomInsertHeight;

///当前的显示位置
@property(nonatomic,assign) CGPoint currentPosition;

///之前的显示位置
@property(nonatomic,assign) CGPoint lastPosition;

///逻辑的cell偏移量
@property(nonatomic,assign) int cellOffset;

///显示的cell偏移量
@property(nonatomic,assign) int displayOffset;

///顶部显示的cell编号
@property(nonatomic,assign) int displayTopCellNum;

///底部显示的cell编号
@property(nonatomic,assign) int displayBottomCellNum;

///编辑的cell编号
@property(nonatomic,assign) int editCellNum;

///当前状态
@property(nonatomic,assign) int state;

///加载次数
@property(nonatomic,assign) int reloadTimes;

///当前页
@property(nonatomic,assign) int pages;

///是否点击列表恢复Cell原位（针对左右滑动）
@property(nonatomic,assign) BOOL isTapTableToRestoreCells;

///cell移除动画时间
@property(nonatomic,assign) double cellRemoveTime;


#pragma -mark 远程图片更新

///远程图片更新定时器
@property(nonatomic,retain,readonly) NSTimer *remoteImageUpdateTimer;

///远程图片更新定时器是否在工作
@property(nonatomic,assign) BOOL isRemoteImageUpdateTimerWorking;

///远程图片更新时间间隔
@property(nonatomic,assign) double remoteImageUpdateInterval;


#pragma -mark 数据

///显示的cell数组
@property(nonatomic,retain,readonly) KATArray<__kindof KATTableCell *> *cellArray;

///cell数据数组
@property(nonatomic,retain,readonly) KATArray<__kindof KATTableCellData *> *dataArray;


#pragma -mark 背景色

///是否包含特殊的背面层背景色
@property(nonatomic,assign) BOOL hasBackBgColor;

///是否包含特殊的中间层背景色
@property(nonatomic,assign) BOOL hasMidBgColor;

///是否包含特殊的表层背景色
@property(nonatomic,assign) BOOL hasFaceBgColor;

///背面层背景颜色
@property(nonatomic,retain) UIColor *backBgColor;

///中间层背景颜色
@property(nonatomic,retain) UIColor *midBgColor;

///表层背景颜色
@property(nonatomic,retain) UIColor *faceBgColor;


#pragma -mark 选中时候的颜色(主动事件，需主动调用cell变色函数)

///选中时的背景颜色
@property(nonatomic,retain) UIColor *tapedBgColor;

///选中时的文本字体颜色
@property(nonatomic,retain) UIColor *tapedTextColor;

///选中时的按钮颜色
@property(nonatomic,retain) UIColor *tapedButtonColor;


#pragma -mark 点击时表层变色(单击颜色一闪，被动事件)

///是否点击时改变cell表层颜色
@property(nonatomic,assign) BOOL isTapToChangeFaceLayerColor;

///点击时的表层颜色
@property(nonatomic,retain) UIColor *tapedFaceLayerColor;

///点击变色时长
@property(nonatomic,assign) float tapChangeColorTime;


#pragma -mark 分割线样式

///线1frame
@property(nonatomic,assign) CGRect line1Frame;

///是否有分割线1
@property(nonatomic,assign) BOOL hasLine1;

///线1颜色
@property(nonatomic,retain) UIColor *line1Color;

///线2frame
@property(nonatomic,assign) CGRect line2Frame;

///是否有分割线2
@property(nonatomic,assign) BOOL hasLine2;

///线2颜色
@property(nonatomic,retain) UIColor *line2Color;

///上分隔线frame
@property(nonatomic,assign) CGRect topLineFrame;

///是否有上分隔线（在底层）
@property(nonatomic,assign) BOOL hasTopLine;

///上分隔线颜色
@property(nonatomic,retain) UIColor *topLineColor;

///下分隔线frame
@property(nonatomic,assign) CGRect bottomLineFrame;

///是否有下分隔线（在底层）
@property(nonatomic,assign) BOOL hasBottomLine;

///下分隔线颜色
@property(nonatomic,retain) UIColor *bottomLineColor;


#pragma -mark cell模块

///是否包含图片
@property(nonatomic,assign) BOOL hasImage;

///是否包含图片2
@property(nonatomic,assign) BOOL hasImage2;

///是否包含图片3
@property(nonatomic,assign) BOOL hasImage3;

///是否包含标题
@property(nonatomic,assign) BOOL hasTitle;

///是否包含内容
@property(nonatomic,assign) BOOL hasContent;

///是否包含富文本标题
@property(nonatomic,assign) BOOL hasRichTitle;

///是否包含富文本内容
@property(nonatomic,assign) BOOL hasRichContent;

///是否包含富文本标签
@property(nonatomic,assign) BOOL hasRichLabel;

///是否包含徽标
@property(nonatomic,assign) BOOL hasBadge;

///是否包含标签1
@property(nonatomic,assign) BOOL hasLabel1;

///是否包含标签2
@property(nonatomic,assign) BOOL hasLabel2;

///是否包含标签3
@property(nonatomic,assign) BOOL hasLabel3;

///是否包含标签4
@property(nonatomic,assign) BOOL hasLabel4;

///是否包含标签5
@property(nonatomic,assign) BOOL hasLabel5;

///是否包含文本控件
@property(nonatomic,assign) BOOL hasText;

///是否有缓冲图片
@property(nonatomic,assign) BOOL hasCacheImage;

///是否为远程图片（需要开线程刷新）
@property(nonatomic,assign) BOOL isRemoteImage;

///缓冲图片
@property(nonatomic,retain) UIImage *cacheImage;


#pragma -mark cell样式

///图片frame
@property(nonatomic,assign) CGRect imageFrame;

///图片2frame
@property(nonatomic,assign) CGRect image2Frame;

///图片3frame
@property(nonatomic,assign) CGRect image3Frame;

///图片圆角
@property(nonatomic,assign) double imageCorner;

///图片2圆角
@property(nonatomic,assign) double image2Corner;

///图片3圆角
@property(nonatomic,assign) double image3Corner;

///标题frame
@property(nonatomic,assign) CGRect titleFrame;

///标题颜色
@property(nonatomic,retain) UIColor *titleColor;

///标题字体
@property(nonatomic,retain) UIFont *titleFont;

///标题对齐方式
@property(nonatomic,assign) NSTextAlignment titleAlignment;

///标题显示行数
@property(nonatomic,assign) int titleLines;

///标题换行模式
@property(nonatomic,assign) NSLineBreakMode titleLineBreak;

///内容frame
@property(nonatomic,assign) CGRect contentFrame;

///内容颜色
@property(nonatomic,retain) UIColor *contentColor;

///内容字体
@property(nonatomic,retain) UIFont *contentFont;

///内容对齐方式
@property(nonatomic,assign) NSTextAlignment contentAlignment;

///内容显示行数
@property(nonatomic,assign) int contentLines;

///内容换行模式
@property(nonatomic,assign) NSLineBreakMode contentLineBreak;

///标签1frame
@property(nonatomic,assign) CGRect label1Frame;

///标签1颜色
@property(nonatomic,retain) UIColor *label1Color;

///标签1字体
@property(nonatomic,retain) UIFont *label1Font;

///标签1对齐方式
@property(nonatomic,assign) NSTextAlignment label1Alignment;

///标签1显示行数
@property(nonatomic,assign) int label1Lines;

///标签1换行模式
@property(nonatomic,assign) NSLineBreakMode label1LineBreak;

///标签2frame
@property(nonatomic,assign) CGRect label2Frame;

///标签2颜色
@property(nonatomic,retain) UIColor *label2Color;

///标签2字体
@property(nonatomic,retain) UIFont *label2Font;

///标签2对齐方式
@property(nonatomic,assign) NSTextAlignment label2Alignment;

///标签2显示行数
@property(nonatomic,assign) int label2Lines;

///标签2换行模式
@property(nonatomic,assign) NSLineBreakMode label2LineBreak;

///标签3frame
@property(nonatomic,assign) CGRect label3Frame;

///标签3颜色
@property(nonatomic,retain) UIColor *label3Color;

///标签3字体
@property(nonatomic,retain) UIFont *label3Font;

///标签3对齐方式
@property(nonatomic,assign) NSTextAlignment label3Alignment;

///标签3显示行数
@property(nonatomic,assign) int label3Lines;

///标签3换行模式
@property(nonatomic,assign) NSLineBreakMode label3LineBreak;

///标签4frame
@property(nonatomic,assign) CGRect label4Frame;

///标签4颜色
@property(nonatomic,retain) UIColor *label4Color;

///标签4字体
@property(nonatomic,retain) UIFont *label4Font;

///标签4对齐方式
@property(nonatomic,assign) NSTextAlignment label4Alignment;

///标签4显示行数
@property(nonatomic,assign) int label4Lines;

///标签4换行模式
@property(nonatomic,assign) NSLineBreakMode label4LineBreak;

///标签5frame
@property(nonatomic,assign) CGRect label5Frame;

///标签5颜色
@property(nonatomic,retain) UIColor *label5Color;

///标签5字体
@property(nonatomic,retain) UIFont *label5Font;

///标签5对齐方式
@property(nonatomic,assign) NSTextAlignment label5Alignment;

///标签5显示行数
@property(nonatomic,assign) int label5Lines;

///标签5换行模式
@property(nonatomic,assign) NSLineBreakMode label5LineBreak;

///文本控件frame
@property(nonatomic,assign) CGRect textFrame;

///文本控件字体颜色
@property(nonatomic,retain) UIColor *textColor;

///文本控件字体
@property(nonatomic,retain) UIFont *textFont;

///文本控件对齐方式
@property(nonatomic,assign) NSTextAlignment textAlignment;

///文本控件背景颜色
@property(nonatomic,retain) UIColor *textBgColor;

///是否包含文本控件边界线
@property(nonatomic,assign) BOOL hasTextBorder;

///文本控件边界线宽
@property(nonatomic,assign) float textBorderWidth;

///文本控件边界线颜色
@property(nonatomic,retain) UIColor *textBorderColor;

///文本控件边界线圆角
@property(nonatomic,assign) double textBorderCorner;

///文本控件是否可编辑
@property(nonatomic,assign) BOOL textCanEdit;

///文本控件代理
//@property(nonatomic,assign) id<UITextViewDelegate> textDelegate;

///徽标字体
@property(nonatomic,retain) UIFont *badgeFont;

///徽标字体颜色
@property(nonatomic,retain) UIColor *badgeTextColor;

///徽标背景颜色
@property(nonatomic,retain) UIColor *badgeBgColor;

///徽标frame
@property(nonatomic,assign) CGRect badgeFrame;

///是否包含徽标边界线
@property(nonatomic,assign) BOOL hasBadgeBorder;

///徽标边界线宽
@property(nonatomic,assign) float badgeBorderWidth;

///徽标边界颜色
@property(nonatomic,retain) UIColor *badgeBorderColor;

///徽标圆角(0.5为半圆)
@property(nonatomic,assign) double badgeCorner;

///徽标行数
@property(nonatomic,assign) int badgeLines;

///徽标换行模式
@property(nonatomic,assign) NSLineBreakMode badgeLineBreak;

///徽标对齐方式
@property(nonatomic,assign) NSTextAlignment badgeAlignment;

///富文本标题frame
@property(nonatomic,assign) CGRect richTitleFrame;

///富文本标题样式
@property(nonatomic,retain) KATTextStyle *richTitleStyle;

///富文本内容frame
@property(nonatomic,assign) CGRect richContentFrame;

///富文本内容样式
@property(nonatomic,retain) KATTextStyle *richContentStyle;

///富文本标签frame
@property(nonatomic,assign) CGRect richLabelFrame;

///富文本标签样式
@property(nonatomic,retain) KATTextStyle *richLabelStyle;


#pragma -mark 按钮

///按钮线宽
@property(nonatomic,assign) float buttonLineWidth;

///是否有按钮点击动画
@property(nonatomic,assign) BOOL hasButtonClickAnimation;

///是否包含按钮1
@property(nonatomic,assign) BOOL hasButton1;

///按钮1类型
@property(nonatomic,assign) KATButtonType button1Type;

///按钮1frame
@property(nonatomic,assign) CGRect button1Frame;

///按钮1颜色
@property(nonatomic,retain) UIColor *button1Color;

///按钮1缩放
@property(nonatomic,assign) float button1Scale;

///是否包含按钮2
@property(nonatomic,assign) BOOL hasButton2;

///按钮2类型
@property(nonatomic,assign) KATButtonType button2Type;

///按钮2frame
@property(nonatomic,assign) CGRect button2Frame;

///按钮2颜色
@property(nonatomic,retain) UIColor *button2Color;

///按钮2缩放
@property(nonatomic,assign) float button2Scale;

///是否包含按钮3
@property(nonatomic,assign) BOOL hasButton3;

///按钮3类型
@property(nonatomic,assign) KATButtonType button3Type;

///按钮3frame
@property(nonatomic,assign) CGRect button3Frame;

///按钮3颜色
@property(nonatomic,retain) UIColor *button3Color;

///按钮3缩放
@property(nonatomic,assign) float button3Scale;

///是否包含特殊按钮
@property(nonatomic,assign) BOOL hasSpButton;


#pragma -mark 背面按钮

///背面按钮线宽
@property(nonatomic,assign) float backButtonLineWidth;

///是否有按钮点击动画
@property(nonatomic,assign) BOOL hasBackButtonClickAnimation;

///是否包含背面按钮1
@property(nonatomic,assign) BOOL hasBackButton1;

///背面按钮1类型
@property(nonatomic,assign) KATButtonType backButton1Type;

///背面按钮1frame
@property(nonatomic,assign) CGRect backButton1Frame;

///背面按钮1颜色
@property(nonatomic,retain) UIColor *backButton1Color;

///背面按钮1缩放
@property(nonatomic,assign) float backButton1Scale;

///是否包含背面按钮2
@property(nonatomic,assign) BOOL hasBackButton2;

///背面按钮2类型
@property(nonatomic,assign) KATButtonType backButton2Type;

///背面按钮2frame
@property(nonatomic,assign) CGRect backButton2Frame;

///背面按钮2颜色
@property(nonatomic,retain) UIColor *backButton2Color;

///背面按钮2缩放
@property(nonatomic,assign) float backButton2Scale;

///是否包含背面按钮3
@property(nonatomic,assign) BOOL hasBackButton3;

///背面按钮3类型
@property(nonatomic,assign) KATButtonType backButton3Type;

///背面按钮3frame
@property(nonatomic,assign) CGRect backButton3Frame;

///背面按钮3颜色
@property(nonatomic,retain) UIColor *backButton3Color;

///背面按钮3缩放
@property(nonatomic,assign) float backButton3Scale;

///是否包含背面按钮4
@property(nonatomic,assign) BOOL hasBackButton4;

///背面按钮4类型
@property(nonatomic,assign) KATButtonType backButton4Type;

///背面按钮4frame
@property(nonatomic,assign) CGRect backButton4Frame;

///背面按钮4颜色
@property(nonatomic,retain) UIColor *backButton4Color;

///背面按钮4缩放
@property(nonatomic,assign) float backButton4Scale;

///是否包含背面按钮5
@property(nonatomic,assign) BOOL hasBackButton5;

///背面按钮5类型
@property(nonatomic,assign) KATButtonType backButton5Type;

///背面按钮5frame
@property(nonatomic,assign) CGRect backButton5Frame;

///背面按钮5颜色
@property(nonatomic,retain) UIColor *backButton5Color;

///背面按钮5缩放
@property(nonatomic,assign) float backButton5Scale;

///是否包含背面按钮6
@property(nonatomic,assign) BOOL hasBackButton6;

///背面按钮6类型
@property(nonatomic,assign) KATButtonType backButton6Type;

///背面按钮6frame
@property(nonatomic,assign) CGRect backButton6Frame;

///背面按钮6颜色
@property(nonatomic,retain) UIColor *backButton6Color;

///背面按钮6缩放
@property(nonatomic,assign) float backButton6Scale;

///是否包含背面按钮7
@property(nonatomic,assign) BOOL hasBackButton7;

///背面按钮7类型
@property(nonatomic,assign) KATButtonType backButton7Type;

///背面按钮7frame
@property(nonatomic,assign) CGRect backButton7Frame;

///背面按钮7颜色
@property(nonatomic,retain) UIColor *backButton7Color;

///背面按钮7缩放
@property(nonatomic,assign) float backButton7Scale;

///是否包含背面标签
@property(nonatomic,assign) BOOL hasBackLabel;

///背面标签frame
@property(nonatomic,assign) CGRect backLabelFrame;

///背面标签字体颜色
@property(nonatomic,retain) UIColor *backLabelColor;

///背面标签字体
@property(nonatomic,retain) UIFont *backLabelFont;

///背面标签对齐方式
@property(nonatomic,assign) NSTextAlignment backLabelAlignment;

///背面标签显示行数
@property(nonatomic,assign) int backLabelLines;

///背面标签换行模式
@property(nonatomic,assign) NSLineBreakMode backLabelLineBreak;


#pragma -mark 无数据提示

///是否包含无数据提示
@property(nonatomic,assign) BOOL hasNoneDataTips;

///无数据提示内容字符串
@property(nonatomic,copy) NSString *strNoneDataTips;

///无数据提示标签
@property(nonatomic,retain) UILabel *noneDataTipsLabel;

///无数据提示标签frame
@property(nonatomic,assign) CGRect noneDataTipsFrame;

///无数据提示字体颜色
@property(nonatomic,retain) UIColor *noneDataTipsTextColor;

///无数据提示字体
@property(nonatomic,retain) UIFont *noneDateTipsTextFont;

///背面标签对齐方式
@property(nonatomic,assign) NSTextAlignment noneDateTipsAlignment;

///背面标签显示行数
@property(nonatomic,assign) int noneDateTipsLines;

///背面标签换行模式
@property(nonatomic,assign) NSLineBreakMode noneDateTipsLineBreak;


#pragma -mark 下拉模块

///是否包含顶部下拉控件
@property(nonatomic,assign) BOOL hasPullHeader;

///顶部下拉控件
@property(nonatomic,retain) KATStandardTableHeader *pullHeader;

///下拉控件高度
@property(nonatomic,assign) double pullHeaderHeight;


#pragma -mark 上推模块

///是否包含顶部上推控件
@property(nonatomic,assign) BOOL hasPushFooter;

///顶部上推控件
@property(nonatomic,retain) KATStandardTableFooter *pushFooter;

///上推控件高度
@property(nonatomic,assign) double pushFooterHeight;



#pragma -mark 背面视图样式

///是否能左移
@property(nonatomic,assign) BOOL canMoveLeft;

///是否能右移
@property(nonatomic,assign) BOOL canMoveRight;

///左移距离
@property(nonatomic,assign) double leftMovingDst;

///右移距离
@property(nonatomic,assign) double rightMovingDst;

///左移弹性距离
@property(nonatomic,assign) double leftMovingFlexibleDst;

///右边移弹性距离
@property(nonatomic,assign) double rightMovingFlexibleDst;

///平移时间
@property(nonatomic,assign) float movingTime;

///是否有拖动事件(有冲突，待解决)
@property(nonatomic,assign) BOOL canPanCell;


#pragma -mark 点击事件

///是否包含cell点击事件
@property(nonatomic,assign) BOOL hasCellTapEvent;

///是否包含cell长按事件
@property(nonatomic,assign) BOOL hasCellLongPressEvent;

///是否包含表层点击事件
@property(nonatomic,assign) BOOL hasFaceLayerTapEvent;

///是否包含中间层点击事件
@property(nonatomic,assign) BOOL hasMidLayerTapEvent;

///是否包含背景层点击事件
@property(nonatomic,assign) BOOL hasBackLayerTapEvent;

///是否包含图片点击事件
@property(nonatomic,assign) BOOL hasImageTapEvent;

///是否包含图片2点击事件
@property(nonatomic,assign) BOOL hasImage2TapEvent;

///是否包含图片3点击事件
@property(nonatomic,assign) BOOL hasImage3TapEvent;

///是否包含标题点击事件
@property(nonatomic,assign) BOOL hasTitleTapEvent;

///是否包含内容点击事件
@property(nonatomic,assign) BOOL hasContentTapEvent;

///是否包含富文本标题点击事件
@property(nonatomic,assign) BOOL hasRichTitleTapEvent;

///是否包含富文本内容点击事件
@property(nonatomic,assign) BOOL hasRichContentTapEvent;

///是否包含富文本标签点击事件
@property(nonatomic,assign) BOOL hasRichLabelTapEvent;

///是否包含标签1点击事件
@property(nonatomic,assign) BOOL hasLabel1TapEvent;

///是否包含标签2点击事件
@property(nonatomic,assign) BOOL hasLabel2TapEvent;

///是否包含标签3点击事件
@property(nonatomic,assign) BOOL hasLabel3TapEvent;

///是否包含标签4点击事件
@property(nonatomic,assign) BOOL hasLabel4TapEvent;

///是否包含标签5点击事件
@property(nonatomic,assign) BOOL hasLabel5TapEvent;

///是否包含按钮1点击事件
@property(nonatomic,assign) BOOL hasButton1TapEvent;

///是否包含按钮2点击事件
@property(nonatomic,assign) BOOL hasButton2TapEvent;

///是否包含按钮3点击事件
@property(nonatomic,assign) BOOL hasButton3TapEvent;

///是否包含特殊按钮点击事件
@property(nonatomic,assign) BOOL hasSpButtonTapEvent;

///是否包含背部按钮1点击事件
@property(nonatomic,assign) BOOL hasBackButton1TapEvent;

///是否包含背部按钮2点击事件
@property(nonatomic,assign) BOOL hasBackButton2TapEvent;

///是否包含背部按钮3点击事件
@property(nonatomic,assign) BOOL hasBackButton3TapEvent;

///是否包含背部按钮4点击事件
@property(nonatomic,assign) BOOL hasBackButton4TapEvent;

///是否包含背部按钮5点击事件
@property(nonatomic,assign) BOOL hasBackButton5TapEvent;

///是否包含背部按钮6点击事件
@property(nonatomic,assign) BOOL hasBackButton6TapEvent;

///是否包含背部按钮7点击事件
@property(nonatomic,assign) BOOL hasBackButton7TapEvent;

///是否包含背部标签点击事件
@property(nonatomic,assign) BOOL hasBackLabelTapEvent;

///是否包含徽标点击事件
@property(nonatomic,assign) BOOL hasBadgeTapEvent;


#pragma -mark 队列

///图片刷新队列
@property(nonatomic,assign) dispatch_queue_t queueImage;

///图片2刷新队列
@property(nonatomic,assign) dispatch_queue_t queueImage2;

///图片3刷新队列
@property(nonatomic,assign) dispatch_queue_t queueImage3;



#pragma -mark 类方法

///获取实例
+ (instancetype)tableWithFrame:(CGRect)frame;


#pragma -mark 对象方法

///获取点击的cell
- (KATTableCell *)getTapedCell;

///初始化cells和下拉、上推等控件
- (void)initTable;

///重新加载数据
- (void)reloadData:(KATArray<__kindof KATTableCellData *> *)dataArray withMessage:(NSString *)message andSucceed:(BOOL)succeed;

///在表尾添加数据数据
- (void)moreData:(KATArray<__kindof KATTableCellData *> *)dataArray withMessage:(NSString *)message;

///刷新列表
- (void)updateTable;

///启动远程图片更新
- (void)startRemoteImageUpdating;

///下拉头部
- (void)pullingHeader;

///上推底部
- (void)pushingFooter;

///所有的Cell都左移
- (void)allCellsMoveLeftWithAnimated:(BOOL)animated;

///所有的Cell都右移
- (void)allCellsMoveRightWithAnimated:(BOOL)animated;

///所有的Cell都回到原位
- (void)allCellsBackToPositionWithAnimated:(BOOL)animated;

///删除cell
- (void)removeCell:(KATTableCell *)cell;

///改变点击色（只针对当前Cell，重用无效）
- (void)changeTapedColorWithCell:(KATTableCell *)cell;

///改变回原色(只针对Cell，重用无效)
- (void)changeOriginalColorWithCell:(KATTableCell *)cell;

///添加cell到指定位置
- (void)addCellWithData:(KATTableCellData *)data andIndex:(int)index;

///在列表头部添加cell
- (void)addCellOnHeadWithData:(KATTableCellData *)data;

///在列表尾部添加cell
- (void)addCellOnTailWithData:(KATTableCellData *)data;

///cell位置上移
- (void)moveUpWithCell:(KATTableCell *)cell;

///cell位置下移
- (void)moveDownWithCell:(KATTableCell *)cell;

///cell位置置顶
- (void)moveTopWithCell:(KATTableCell *)cell;

///cell位置置底
- (void)moveBottomWithCell:(KATTableCell *)cell;

///修改cell
- (void)updateCellWithData:(KATTableCellData *)data;

///通过index排列cells
- (void)sortCellsByIndexAndOrder:(BOOL)asc;

///通过tag排列cells
- (void)sortCellsByTagAndOrder:(BOOL)asc;

///通过type排列cells
- (void)sortCellsByTypeAndOrder:(BOOL)asc;

///通过value排列cells
- (void)sortCellsByValueAndOrder:(BOOL)asc;

///通过message排列cells
- (void)sortCellsByMessageAndOrder:(BOOL)asc;

///通过title排列cells
- (void)sortCellsByTitleAndOrder:(BOOL)asc;

///隐藏键盘
- (void)hideKeyboard;


///释放内存
- (void)dealloc;


@end


